<template>
  <div id="cqd">
    <el-row>
      <el-table :data="table.data">
        <el-table-column type="index" label="序号" width="70"></el-table-column>
        <el-table-column prop="sf" label="省份" show-overflow-tooltip></el-table-column>
        <el-table-column prop="mkmc" label="煤矿名称" ></el-table-column>
        <el-table-column prop="yjmc" label="报警名称" ></el-table-column>
        <el-table-column prop="bjtj" min-width="140"  label="报警条件"></el-table-column>
        <el-table-column prop="startTime" min-width="140" label="报警开始时间" show-overflow-tooltip></el-table-column>
        <el-table-column prop="endTime" min-width="140" label="报警结束时间" show-overflow-tooltip></el-table-column>
        <el-table-column prop="xq" min-width="300" label="详情"></el-table-column>
      </el-table>
    </el-row>
    <!-- 分页信息栏 -->
    <el-row class="pagination-bar">
      <el-col :span="8" class="page-info">显示第&nbsp;{{currentStart}}&nbsp;至&nbsp;{{currentEnd}}&nbsp;项结果，共&nbsp;{{table.total}}&nbsp;项</el-col>
      <el-col :span="16" class="text-right">
        <el-pagination
          layout="prev,pager,next,jumper"
          :total="table.total"
          :current-page.sync="table.currentPage"
          :page-size="table.pageSize"
          @current-change="initData"
        ></el-pagination>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  props: {
    zbjcdata: {
      type: Object,
      default: {}
    }
  },
  data() {
    return {
      table: {
        data: [
          {
           sf:"河南省",
           mkmc:"城郊煤矿",
           yjmc:"主通风机双停",
           bjtj:"两台风机均停机持续时间>1min",
           startTime:"2021/7/8 12:16:13",
           endTime:"2021/7/8 12:16:13",
           xq:"永煤公司城郊矿三级矿井停风预警：主扇传感器(城郊.西风井通风.1号风机.主机运行,城郊.西风井通风.1号风机.负压,城郊.西风井通风.2号风机.负压,城郊.西风井通风.2号风机.主机运行)停电状态持续时间2分钟，负压传感器负压下降>50%。",
          },
          {
           sf:"贵州省",
           mkmc:"轿子山煤矿",
           yjmc:"主通风机单回路运行",
           bjtj:"单回路进线柜电压值为0大于2小时",
           startTime:"2021/6/23 10:33:05",
           endTime:"2021/6/24 10:59:46",
           xq:"贵州公司轿子山矿主通风机单回路运行超过2小时，请轿子山矿立即启动相应应急预案，查明原因排除故障，尽快恢复主通风机双回路供电（测点名：通风机1_2级_母线电压,通风机2_1级_母线电压,通风机1_1级_母线电压,通风机2_2级_母线电压）！",
          },
          {
           sf:"河南省",
           mkmc:"党家河煤矿",
           yjmc:"主通风机电机绕组超温",
           bjtj:"非风机倒台情况下风机电机绕组温度比前一日同时期温度高15℃或大于105℃（电机一直有电流情况下）",
           startTime:"2021/6/23 10:33:05",
           endTime:"2021/6/24 10:59:46",
           xq:"鹤煤公司党家河矿主通风机电机绕组温度异常，请立即查明原因（测点：通风一号风机二级电机定子温度A（106℃）,通风一号风机一级电机定子温度C（110℃）,通风一号风机一级电机定子温度B（124℃）,通风一号风机二级电机定子温度B（95℃）,通风一号风机二级电机定子温度C（102℃））。",
          },
         
          {
           sf:"河南省",
           mkmc:"城郊煤矿",
           yjmc:"主通风机单回路运行",
           bjtj:"单回路进线柜电压值为0大于2小时",
           startTime:"2020/10/14 17:21:18",
           endTime:"2021/4/15 8:30:25",
           xq:"永煤公司城郊矿主通风机单回路运行超过2小时，请城郊矿立即启动相应应急预案，查明原因排除故障，尽快恢复主通风机双回路供电（附：测点名：城郊.西风井通风.2号风机.输入电压）！报警原因: 目前风井启动方式由变频改为工频，暂不显示变频电压，建议由电流进行监视风机启停　　消警措施: 暂无      负责人:李彬      消警时间:2021-4-15 8:30:25      措施执行人:王颜伟",
          },
          {
           sf:"贵州省",
           mkmc:"下寨煤矿",
           yjmc:"主通风机未反风",
           bjtj:"1年内无风机“反风操作”“反向风门状态为1”操作且负压计为正压情况持续时间不超过1小时。",
           startTime:"2020/12/30 17:21:18",
           endTime:"2020/12/30 23:30:25",
           xq:"2020年下寨煤矿全年无反风记录。",
          },
        ], //数据
        total: 0, //总条数
        currentPage: 1, //当前页码
        pageSize: 10 //每页条数
      },
    };
  },
  mounted() {
    this.table.total = this.table.data.length;
    // this.initData();
    // this.initData1();
    // this.initData2();
  },
  computed: {
    // 数据起点
    currentStart() {
      return this.table.total == 0
        ? 0
        : (this.table.currentPage - 1) * this.table.pageSize + 1;
    },
    // 数据终点
    currentEnd() {
      return this.currentStart == 0
        ? 0
        : this.currentStart + this.table.pageSize - 1 > this.table.total
        ? this.table.total
        : this.currentStart + this.table.pageSize - 1;
    }
  },
  methods: {
    openDetail(row){
      this.diaDetail.show = true;
      this.diaDetail.title = row.mkmc+"详情"
    },
    initData() {
      this.request({
        url: "data/getData/3.10",
        method: "get"
      }).then(data => {
        this.diaDetail.data = data.data;
      });
    },
    initData1() {
      this.request({
        url: "data/getData/3.7",
        method: "get"
      }).then(data => {
        this.table.data1 = data.data;
      });
    },
    initData2() {
      this.request({
        url: "data/getData/3.8",
        method: "get"
      }).then(data => {
        this.table.data2 = data.data;
      });
    }
  }
};
</script>
<style lang="less" scoped>
#cqd /deep/ ::-webkit-scrollbar-thumb {
  background-color: #dddddd !important;
}
</style>